home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / sound / sbf3.zip / GETVOL.C < prev    next >
Text File  |  1993-09-19  |  1KB  |  64 lines

  1. #include <stdio.h>
  2. #include <dos.h>
  3. #include <conio.h>
  4.  
  5. #define MASTER_VOL  0x22
  6. #define VOC_VOL     0x04
  7. #define LINE_VOL    0x2e
  8. #define FM_VOL        0x26
  9. #define CD_VOL        0x28
  10. #define RECORD_SRC  0x0C
  11.  
  12. #define MIC        0x11
  13. #define LINE        0x17
  14. #define CD        0x13
  15.  
  16. void main()
  17. {
  18.     unsigned char vol;
  19.     int left, right;
  20.  
  21.     outportb(0x224, MASTER_VOL);
  22.     vol = inportb(0x225);
  23.  
  24.     left = vol >> 4;
  25.     right = vol & 0x0f;
  26.  
  27.     printf("Master volume is %d,%d\n", left, right);
  28.  
  29.     outportb(0x224, VOC_VOL);
  30.     vol = inportb(0x225);
  31.  
  32.     left = vol >> 4;
  33.     right = vol & 0x0f;
  34.  
  35.     printf("VOC volume is %d,%d\n", left, right);
  36.  
  37.     outportb(0x224, LINE_VOL);
  38.     vol = inportb(0x225);
  39.  
  40.     left = vol >> 4;
  41.     right = vol & 0x0f;
  42.  
  43.     printf("Line volume is %d,%d\n", left, right);
  44.  
  45.     outportb(0x224, FM_VOL);
  46.     vol = inportb(0x225);
  47.  
  48.     left = vol >> 4;
  49.     right = vol & 0x0f;
  50.  
  51.     printf("FM volume is %d,%d\n", left, right);
  52.  
  53.     outportb(0x224, CD_VOL);
  54.     vol = inportb(0x225);
  55.  
  56.     left = vol & 0x0f;
  57.     printf("CD volume is %d\n", left);
  58.  
  59.     outportb(0x224, RECORD_SRC);
  60.     left = inportb(0x225);
  61.  
  62.     printf("Recording source is %d\n", left);
  63. }
  64.